#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>

char v[100] = "\0";

void sig_handler(int s){
    printf("%s\n", v);
    signal(SIGUSR1,sig_handler);
}

void main(int argc, char* argv[]){
    signal(SIGUSR1,sig_handler);
    if (argc == 2) {
	strcpy(v,argv[1]);
        printf("pid = %d\n", getpid());
    }

    while (1) {
        sleep(1);
    }
}

